]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
modalDialog: Add alternative keys to activate default
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 4 Oct 2012 18:03:57 +0000 (20:03 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 4 Oct 2012 19:18:54 +0000 (21:18 +0200)
Currently Return is used to activate the default button of a modal
dialog if no key is specified. It makes sense to allow alternatives
as the keypad's Enter key as well in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=685511

js/ui/modalDialog.js

index f0c93467692809f0b6e379984e97e3b9d416034b..3f7233f9a88f433782d4a8a2e9e5853121eeeeba 100644 (file)
@@ -131,8 +131,11 @@ const ModalDialog = new Lang.Class({
             let key = buttonInfo['key'];
             let isDefault = buttonInfo['default'];
 
-            if (isDefault && !key)
+            if (isDefault && !key) {
+                this._actionKeys[Clutter.KEY_KP_Enter] = action;
+                this._actionKeys[Clutter.KEY_ISO_Enter] = action;
                 key = Clutter.KEY_Return;
+            }
 
             buttonInfo.button = new St.Button({ style_class: 'modal-dialog-button',
                                                 reactive:    true,